home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_400
/
436_01
/
inlib.mak
< prev
next >
Wrap
Text File
|
1994-10-07
|
5KB
|
132 lines
#==========================================================================
# INLIB.MAK
#
# Creates INCONx.LIB for the memory model defined on the
# command line ("-DMDL=x"), where x is one of s, c, m, or l.
# Does an unconditional build of each library, placing the
# .LIB file into the directory named in O_DIR.
#
# MAKE.EXE doesn't support redirection on ECHO, so this file
# calls INLIB.BAT to move INCON's header files into the output
# directory and create INLIB.H. If the INLIB.BAT is not available,
# you can recreate it from the following comments (note that the
# "ECHO/ " statements are followed by a space, and the spaces in the
# FOR...IN...DO statement).
#
# ::INLIB.BAT
# echo off
# ::Filter out root, shorthand, and (most) invalid path names.
# for %%x in (\ . .\ .\\ .. ..\ ..\\) do if "%%x"=="%1" goto :BAD_PATH
# if not exist %1nul goto :BAD_PATH
# echo Creating inlib.rsp ...
# echo -+%1incon & > inlib.rsp
# echo -+%1inalpha & >> inlib.rsp
# echo -+%1infloat & >> inlib.rsp
# echo -+%1inintgr & >> inlib.rsp
# echo -+%1intempl & >> inlib.rsp
# echo -+%1inutil & >> inlib.rsp
# echo -+%1stringz.obj >> inlib.rsp
# echo/
# echo Copying INCON header files to %1 ...
# echo/
# echo copy indefs.h %1indefs.h
# copy indefs.h %1indefs.h > nul
# echo copy indecl.h %1indecl.h
# copy indecl.h %1indecl.h > nul
# echo copy stringz.h %1stringz.h
# copy stringz.h %1stringz.h > nul
# echo/
# echo Creating %1inlib.h ...
# echo #include "%1indefs.h" > %1inlib.h
# echo #include "%1indecl.h" >> %1inlib.h
# echo #include "%1stringz.h" >> %1inlib.h
# echo/
# echo Contents of %1inlib.h:
# echo/
# type %1inlib.h
# goto :EXIT
# :BAD_PATH
# echo Invalid path: %1
# echo/
# echo Path must be name, ending with '\'
# goto :EXIT
# :EXIT
#==========================================================================
#
# TCC options are:
# -c compile to OBJ
# -d merge duplicate strings
# -f- no floating point
# -G optimize for speed
# -I include directories
# -L library directories
# -mx memory model x
# -O jump optimization
# -o name object file
# -r use register variables
# -w display all warnings
# -Z register optimization
#
# TASM options are:
# /ml all symbols case sensitive
# /t suppress messages if assembly ok
# /w2 enable warning messages
# /z display source line w/error message
#
# TLIB options are:
# /C case-sensitive library
# /E create extended dictionary
#==========================================================================
# If memory model not defined, use large.
!if !$d(MDL)
MDL=l
!endif
# Define paths for Turbo C and output directories. Make changes to
# these constants if your directory structure is set up differently.
# O_DIR tells TCC and TASM where to put the object files, and TLIB
# where to build the library. The batch files listed above adapt
# to any changes you make to O_DIR (note the trailing backslash).
TCC = \tc\tcc # path to TCC.EXE
TASM = \tasm\tasm # path to TASM.EXE
TLIB = \tc\tlib # path to TLIB.EXE
TLINK = \tc\tlink # path to TLINK.EXE
O_DIR = \tc\usr\ # output directory
# (note the trailing '\')
I_DIR = \tc\inc;\tc\inc\sys # include directory
C_OPTS = -c -d -f- -G -I$(I_DIR) -m$(MDL) -O -r -w -Z
A_OPTS = /ml/t/w2/z
COMPILE = $(TCC) $(C_OPTS)
# Call INLIB.BAT to create INLIB.RSP, move the required header
# files into O_DIR, and create INLIB.H. Then do an unconditional
# compile of each file required by the library and put the object
# files into O_DIR. After the library has been created, delete
# the old library and all of the object files.
#
# The compiler command lines below include a macro defined by
# Borland's MAKE.EXE that allows use of switches stored in
# environment variables. The macros below all reference an
# environment variable named X, defined by "set x=text_string".
$(O_DIR)incon$(MDL).lib:
inlib $(O_DIR) # call INLIB.BAT
$(COMPILE) $(X) -o$(O_DIR)incon incon
$(COMPILE) $(X) -o$(O_DIR)inalpha inalpha
$(COMPILE) $(X) -o$(O_DIR)infloat infloat
$(COMPILE) $(X) -o$(O_DIR)inintgr inintgr
$(COMPILE) $(X) -o$(O_DIR)intempl intempl
$(COMPILE) $(X) -o$(O_DIR)inutil inutil
$(TASM) $(A_OPTS) stringz, $(O_DIR)stringz;
del $(O_DIR)incon$(MDL).lib
$(TLIB) $(O_DIR)incon$(MDL) @inlib.rsp
del $(O_DIR)incon$(MDL).bak
del $(O_DIR)in*.obj
del inlib.rsp
# EOF: INLIB.MAK